import { reactive } from "vue";
import type { FormRules } from "element-plus";

export const formRules = reactive(<FormRules>{
  name: [
    { required: true, message: "触发器名称为必填项", trigger: "blur" },
    {
      min: 1,
      max: 50,
      message: "触发器名称长度应在1-50个字符之间",
      trigger: "blur"
    }
  ],
  triggerCondition: [
    { required: true, message: "触发条件为必填项", trigger: "blur" },
    {
      min: 1,
      max: 200,
      message: "触发条件长度应在1-200个字符之间",
      trigger: "blur"
    }
  ],
  action: [
    { required: true, message: "触发动作为必填项", trigger: "blur" },
    {
      min: 1,
      max: 200,
      message: "触发动作长度应在1-200个字符之间",
      trigger: "blur"
    }
  ],
  lesseeId: [{ required: true, message: "请选择租户", trigger: "change" }],
  status: [{ required: true, message: "请选择状态", trigger: "change" }]
});
